package com.jeomo.sys.starter.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.jeomo.base.starter.entity.BaseCodeEntity;
import com.jeomo.sys.api.enums.RoleTypeEnum;

import java.util.List;

/**
 * <p>
 * 系统角色
 * 角色应是组织分离的
 * 即每个组织都有自己的角色体系
 * </p>
 * @author jeomo
 * @since 2019-03-22
 */
@TableName("sys_role")
public class Role extends BaseCodeEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 顶级组织码
     */
    private String topOrgCode;

    /**
     * 上级目录
     */
    private String parentCode;

    /**
     * 角色类型
     */
    private RoleTypeEnum type;

    /**
     * 角色名称
     */
    private String name;

    /**
     * 角色拥有的菜单
     */
    @TableField(exist = false)
    private List<Permission> permissions;

    public String getTopOrgCode() {
        return topOrgCode;
    }

    public void setTopOrgCode(String topOrgCode) {
        this.topOrgCode = topOrgCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<Permission> getPermissions() {
        return permissions;
    }

    public void setPermissions(List<Permission> permissions) {
        this.permissions = permissions;
    }

    public String getParentCode() {
        return parentCode;
    }

    public void setParentCode(String parentCode) {
        this.parentCode = parentCode;
    }

    public RoleTypeEnum getType() {
        return type;
    }

    public void setType(RoleTypeEnum type) {
        this.type = type;
    }
}
